#include <WallTile_V_A.h>

#include <RenderObject.h>
#include <GraphicData.h>
#include <RenderManager.h>
#include <PhysicsObject.h>
#include <Physics.h>
#include <ObjectManager.h>

WallTile_V_A::WallTile_V_A()
{
	syncComplete = 0;

	float WallColor[4] = {0.8,0.8,0.8,1};
	gfx = External::renderer->CreateRenderObject( &t, External::renderer->LoadGfxFromBMP( "./Graphics/WallTile_V.bmp" ) );
	gfx->SetColor(0, WallColor[0], WallColor[1], WallColor[2]);
	gfx->gfx->solid[0] = 1;

	t.loc = vec2(100,100);
	t.angle = 0;
	t.scale = 5.0f;

	//velocity = vec2( -10 + 20*Global::GetRandomFloat(), -10 + 20*Global::GetRandomFloat() );


	phys = new PhysicsObject( this, &t, External::physics->LoadBoundingBox("./Graphics/WallTile_V_A.bb"), b2_staticBody );
	
	phys->body->SetTransform( t.loc, -t.angle * Global::PI / 180.0f );
	//phys->body->SetLinearVelocity( velocity );
}

WallTile_V_A::~WallTile_V_A()
{
	delete phys;
}
	
std::string WallTile_V_A::GetTypeName()
{
	return "WallTile_V_A";
}
	
std::string WallTile_V_A::GetTextName()
{
	return "Wall Tile Verticle A";
}

void WallTile_V_A::Update(float dt)
{
	if(!syncComplete)
		SyncTransformToPhysics();
	syncComplete=1;
}
		
void WallTile_V_A::DoCollision(BaseObject* objectCollidedWith)
{
	
}
